FROM ubuntu:16.04

MAINTAINER YifeiChan <leochan007@163.com>

ENV DEBIAN_FRONTEND noninteractive

ENV LC_ALL C.UTF-8
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# apt and pip mirrors

RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak

RUN  echo "deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse \n\
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse \n\
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse \n\
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse \n\n\
##测试版源 \n\n\
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse \n\n\
##源码 \n\n\
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse \n\
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse \n\
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse \n\
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse \n\n\
##测试版源 \n\n\
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse \n\
# Canonical 合作伙伴和附加 \n\
deb http://archive.canonical.com/ubuntu/ xenial partner" > /etc/apt/sources.list

RUN mkdir -p ~/.pip \
    && echo "[global]" > ~/.pip/pip.conf \
    && echo "timeout=60" >> ~/.pip/pip.conf \
    && echo "index-url=https://pypi.doubanio.com/simple" >> ~/.pip/pip.conf

RUN apt-get update

RUN apt-get install -y masscan curl net-tools telnet tzdata rsyslog

RUN apt-get install -y gcc g++ automake autoconf libtool make

RUN apt-get install -y vim git

# libzlib-dev libbzip2-dev
RUN apt-get install -y libssl-dev libncurses-dev libsqlite-dev libreadline-dev

WORKDIR /root

ADD lua-5.3.4.tar.gz /root/

#RUN curl -O http://www.lua.org/ftp/lua-5.3.4.tar.gz && tar -xvf lua-5.3.4.tar.gz && cd lua-5.3.4 && make linux

RUN cd lua-5.3.4 && make linux && make install

WORKDIR /root

ADD update_python2.7.sh Python-2.7.14.tar.xz get-pip.py /root/

RUN chmod 755 update_python2.7.sh && ./update_python2.7.sh

RUN apt-get install -y cron

RUN pip install -U pip

RUN pip install python-libnmap python-nmap

RUN pip install lxml python-crontab

#RUN apt-get install -y nmap

ADD nmap-7.60.tar.bz2 /root/

RUN cd nmap-7.60 && ./configure && make && make install

ADD my_cron /root

RUN crontab /root/my_cron

RUN apt-get install -y libsqlite3-dev

RUN pip install -U pysqlite

#ADD pygtk-2.24.0.tar.bz2 /root/

#RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
